//
//  Connection.h
//  HiQ
//
//  Created by maxwell pang on 12-7-24.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "GCDAsyncSocket.h"
#import "ConnectionDelegate.h"

@interface Connection : NSObject
{
	GCDAsyncSocket *socket;
    dispatch_queue_t socketQueue;
    NSString *host;
    UInt16 port;
}

@property (nonatomic,strong) id<ConnectionDelegate> delegate;

- (id) initWithHostAddress:(NSString *)host andPort:(NSInteger)port;

+(id) sharedServerConnection;

- (void) sendMsg:(NSString *)msg cmd:(NSUInteger)_cmdFlag subcmd:(NSUInteger)_subCmdFlag;

//发送Data接口
//add by arvintan 12-8-1
-(void) sendData:(NSData *)_data cmd:(NSUInteger)_cmdFlag subcmd:(NSUInteger)_subCmdFlag;

@end
